package com.example.demos.web.controller;

import com.example.demos.dto.bymonth.ByMonthDTO;
import com.example.demos.dto.bymonth.ByMonthDetailDTO;
import com.example.demos.entity.Emp;
import com.example.demos.service.ByMonthService;
import com.example.demos.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ByMonthController {
    @Autowired
    private ByMonthService byMonthService;
    @GetMapping("/v2/byMonth")
    public Result<List<ByMonthDetailDTO>> byMonth(String year){

        return Result.ok(byMonthService.select1(year));
    }
}
